package response

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

// D 是 map[string]interface{} 的简写
type D map[string]interface{}

// 数据返回结构体
type JsonStruct struct {
	Status  int         `json:"status"`
	Message interface{} `json:"message"`
	Data    interface{} `json:"data"`
}

func ResponseException(c *gin.Context, status int, message string, data interface{}) {
	json := &JsonStruct{Status: status, Message: message, Data: data}
	c.JSON(http.StatusOK, json)
}
